﻿//
//  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
//  PURPOSE. IT CAN BE DISTRIBUTED FREE OF CHARGE AS LONG AS THIS HEADER 
//  REMAINS UNCHANGED.
//
//  Email:  lukasz@istrib.org
//
//  Copyright (C) 2008-2009 Lukasz Kwiecinski. 
//
//  LAME ( LAME Ain't an Mp3 Encoder ) 
//  You must call the fucntion "beVersion" to obtain information  like version 
//  numbers (both of the DLL and encoding engine), release date and URL for 
//  lame_enc's homepage. All this information should be made available to the 
//  user of your product through a dialog box or something similar.
//  You must see all information about LAME project and legal license infos at 
//  http://www.mp3dev.org/  The official LAME site
//
//
//  About Thomson and/or Fraunhofer patents:
//  Any use of this product does not convey a license under the relevant 
//  intellectual property of Thomson and/or Fraunhofer Gesellschaft nor imply 
//  any right to use this product in any finished end user or ready-to-use final 
//  product. An independent license for such use is required. 
//  For details, please visit http://www.mp3licensing.com.
//

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Istrib.Sound.Formats;
using System.IO;

namespace Istrib.Sound.Example.WinForms
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }


        private void startBtn_Click(object sender, EventArgs e)
        {
            try
            {
                mp3SoundCapture.CaptureDevice = SoundCaptureDevice.Default;
                mp3SoundCapture.NormalizeVolume = false;

                mp3SoundCapture.OutputType = Mp3SoundCapture.Outputs.Wav;

                mp3SoundCapture.WaveFormat = PcmSoundFormat.Pcm8kHz8bitMono;
                //mp3SoundCapture.Mp3BitRate = (Mp3BitRate)bitRateCmb.SelectedItem;
                mp3SoundCapture.WaitOnStop = true;
                mp3SoundCapture.Start("hurrr.wav");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Not so easy...", MessageBoxButtons.OK, MessageBoxIcon.Stop);
            }
        }


    }
}
